//webpack配制文件需要用commonjs模块化规范来编写，因为这是nodejs环境

//const webpack = require('webpack'); //需要事先安装
const path = require('path');
const webpackConfig = {
    entry: {
        'boundle': './app.js'
    },
    output: {
        path: path.resolve(__dirname, './dist'),
        filename: '[name]-min.js'
    },
    modules: {
        rules: [
            {
                test: /\.js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env']
                    }
                }
            }
        ]
    }
};
module.exports = webpackConfig;